var webpack = require('webpack')
var htmlWebpackPlugin = require('html-webpack-plugin')
var path = require('path')

module.exports = {
    mode: 'development',
    devtool: 'source-map',
    context: path.resolve(__dirname, '..', 'src'),
    entry: {
        index: path.resolve(__dirname, '..', 'example', 'index.js')
    },
    target: 'web',
    output: {
        filename: '[id].[chunkhash].js',
    },
    plugins: [
        new htmlWebpackPlugin({
            template: '../index.html'
        }),
        new webpack.DefinePlugin({
            env: JSON.stringify('development')
        })
    ],
    devServer: {
        host: '0.0.0.0',
        port: 9000,
        historyApiFallback: true,
        open: true
    }
}